//
//  SeverceHttpRequest.h
//  网络封装
//
//  Created by hcios on 2017/6/30.
//  Copyright © 2017年 hcios. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

typedef NS_ENUM(NSUInteger,SeverceHttpRequestType){
    SeverceHttpRequestGet = 0,
    SeverceHttpRequestPost
};

@interface SeverceHttpRequest : NSObject

+(SeverceHttpRequest *)sharedManager;

/**
 *  GET请求
 *
 *  @param URLString 网址
 *  @param parameters  传递参数
 *  @param success  成功block回调
 *  @param failure  失败block回调
 */
-(void)GET:(NSString *)URLString parameters:(NSDictionary *)parameters success:(void(^)(id reponseObject)) success failure:(void(^)(NSError *error))failure;


/**
 *  POST请求
 *
 *  @param URLString 网址
 *  @param parameters  传递参数
 *  @param success  成功block回调
 *  @param failure  失败block回调
 */
-(void)POST:(NSString *)URLString parameters:(NSDictionary *)parameters success:(void(^)(id reponseObject))success failure:(void(^)(NSError *eror))failure;


/**
 *  request类型说明
 *
 *  @param URLString 网址
 *  @param parameters  传递参数
 *  @param type 参数属性
 *  @param success  成功block回调
 *  @param failure  失败block回调
 */
-(void)request:(NSString *)URLString parameters:(NSDictionary *)parameters type:(SeverceHttpRequestType)type success:(void(^)(id reponseObject))success failure:(void(^)(NSError *error))failure;


@end
